package dao;

import domain.ContractType;
import domain.ContractTypeExample;
import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultMap;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import org.springframework.stereotype.Repository;

@Repository
public interface ContractTypeMapper {
    long countByExample(ContractTypeExample example);

    int deleteByExample(ContractTypeExample example);

    @Delete({
        "delete from contract_type",
        "where Id = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into contract_type (Id, type_code, ",
        "name)",
        "values (#{id,jdbcType=INTEGER}, #{typeCode,jdbcType=VARCHAR}, ",
        "#{name,jdbcType=VARCHAR})"
    })
    int insert(ContractType record);

    int insertSelective(ContractType record);

    List<ContractType> selectByExample(ContractTypeExample example);

    @Select({
        "select",
        "Id, type_code, name",
        "from contract_type",
        "where Id = #{id,jdbcType=INTEGER}"
    })
    @ResultMap("dao.ContractTypeMapper.BaseResultMap")
    ContractType selectByPrimaryKey(Integer id);

    int updateByExampleSelective(@Param("record") ContractType record, @Param("example") ContractTypeExample example);

    int updateByExample(@Param("record") ContractType record, @Param("example") ContractTypeExample example);

    int updateByPrimaryKeySelective(ContractType record);

    @Update({
        "update contract_type",
        "set type_code = #{typeCode,jdbcType=VARCHAR},",
          "name = #{name,jdbcType=VARCHAR}",
        "where Id = #{id,jdbcType=INTEGER}"
    })
    int updateByPrimaryKey(ContractType record);
}